<?php

if($dbprocess == 'savelink' ){
	// Cosas para crear nuevo proyecto
	$data=array();
	$data['screen_id'] = $_POST['screen_id'];
	$data['reference'] = $_POST['reference'];
	$data['width'] = $_POST['width'];
	$data['heigth'] = $_POST['height'];
	$data['xaxis'] = $_POST['xaxis'];
	$data['yaxis'] = $_POST['yaxis'];
	$data['type'] = $_POST['type'];
	$data['color'] = '0099FF';
	$data['user_id'] = $_SESSION['userId'];
	$data['create_at'] = date("Y-m-d");
	
	$r=createLink($data);
	
	require_once 'inc/includes/JSON.php';
	$json = new Services_JSON();
		
	if($r){
		logg('se guardo ok');
		$id=mysql_insert_id();
		
		$response = new stdClass();
		$response->status=1;
		$response->id=$id;
		
		echo $jsonString = $json->encode($response);
		exit;
	}else{
		logg('Error al guardar');
		$response = new stdClass();
		$response->status=0;
		
		echo $jsonString = $json->encode($response);
		exit;
	}
	exit;
}



?>